]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
js: Port dbusUtils to ESM
authorFlorian Müllner <fmuellner@gnome.org>
Mon, 7 Aug 2023 15:13:48 +0000 (17:13 +0200)
committerMarge Bot <marge-bot@gnome.org>
Mon, 7 Aug 2023 19:05:50 +0000 (19:05 +0000)
The module is shared between the various D-Bus services and the
main gnome-shell process, so it was originally left out to allow
porting different bits at their own speed.

Now that everything has been ported to ESM, there is no reason
to not move that particular module as well.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2868>

js/dbusServices/extensions/extensionsService.js
js/dbusServices/notifications/notificationDaemon.js
js/dbusServices/screencast/screencastService.js
js/dbusServices/screensaver/screenSaverService.js
js/misc/.eslintrc.yml [deleted file]
js/misc/dbusUtils.js
js/misc/fileUtils.js
js/ui/status/backgroundApps.js

index 18069645844b8d2703fabb618336a71b5162ec59..0d60fb60eb48274c29432a44c77f61def375eee7 100644 (file)
@@ -7,7 +7,7 @@ import {ExtensionPrefsDialog} from './extensionPrefsDialog.js';
 import {ServiceImplementation} from './dbusService.js';
 
 import {deserializeExtension} from './misc/extensionUtils.js';
-const {loadInterfaceXML} = imports.misc.dbusUtils;
+import {loadInterfaceXML} from './misc/dbusUtils.js';
 
 const ExtensionsIface = loadInterfaceXML('org.gnome.Shell.Extensions');
 const ExtensionsProxy = Gio.DBusProxy.makeProxyWrapper(ExtensionsIface);
index 7bb5b7bf0237d83dc08eb2e43697ca7da8f43b18..f824f813d871faaa389f727a898da672883e46ef 100644 (file)
@@ -4,7 +4,7 @@ import GLib from 'gi://GLib';
 
 import {ServiceImplementation} from './dbusService.js';
 
-const {loadInterfaceXML} = imports.misc.dbusUtils;
+import {loadInterfaceXML} from './misc/dbusUtils.js';
 
 const NotificationsIface = loadInterfaceXML('org.freedesktop.Notifications');
 const NotificationsProxy = Gio.DBusProxy.makeProxyWrapper(NotificationsIface);
index 60b0afd0899e745b29203e63c5c160d9d175218f..9c69af9cf5f03b02b34b813b7271ea725a1a2d30 100644 (file)
@@ -6,7 +6,7 @@ import Gtk from 'gi://Gtk?version=4.0';
 
 import {ServiceImplementation} from './dbusService.js';
 
-const {loadInterfaceXML, loadSubInterfaceXML} = imports.misc.dbusUtils;
+import {loadInterfaceXML, loadSubInterfaceXML} from './misc/dbusUtils.js';
 import * as Signals from './misc/signals.js';
 
 const ScreencastIface = loadInterfaceXML('org.gnome.Shell.Screencast');
index d0f0db6e38a2c3e8af5b89579d4eb24df937cb99..5771b706518e4fd2bd8ffacee70b85cee3fae4ac 100644 (file)
@@ -4,7 +4,7 @@ import GLib from 'gi://GLib';
 
 import {ServiceImplementation} from './dbusService.js';
 
-const {loadInterfaceXML} = imports.misc.dbusUtils;
+import {loadInterfaceXML} from './misc/dbusUtils.js';
 
 const ScreenSaverIface = loadInterfaceXML('org.gnome.ScreenSaver');
 const ScreenSaverProxy = Gio.DBusProxy.makeProxyWrapper(ScreenSaverIface);
diff --git a/js/misc/.eslintrc.yml b/js/misc/.eslintrc.yml
deleted file mode 100644 (file)
index 4526a5c..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-overrides:
-  - files:
-      - dbusUtils.js
-    parserOptions:
-      sourceType: script
\ No newline at end of file
index 686c63f20dc36222e21916d335a43bc51e2be38a..ae7e2c9527771e7d4006fc75740662cae28652fc 100644 (file)
@@ -1,8 +1,7 @@
-/* exported loadInterfaceXML, loadSubInterfaceXML */
+import Gio from 'gi://Gio';
+import GLib from 'gi://GLib';
 
 const Config = imports.misc.config;
-const Gio = imports.gi.Gio;
-const GLib = imports.gi.GLib;
 
 let _ifaceResource = null;
 
@@ -24,7 +23,7 @@ function _ensureIfaceResource() {
  * @param {string} iface the interface name
  * @returns {string | null} the XML string or null if it is not found
  */
-function loadInterfaceXML(iface) {
+export function loadInterfaceXML(iface) {
     _ensureIfaceResource();
 
     let uri = `resource:///org/gnome/shell/dbus-interfaces/${iface}.xml`;
@@ -45,7 +44,7 @@ function loadInterfaceXML(iface) {
  * @param {string} ifaceFile the interface filename
  * @returns {string | null} the XML string or null if it is not found
  */
-function loadSubInterfaceXML(iface, ifaceFile) {
+export function loadSubInterfaceXML(iface, ifaceFile) {
     let xml = loadInterfaceXML(ifaceFile);
     if (!xml)
         return null;
index b5e355bbe12a56e6a42f1c87bb18192bc3639209..a885a08ef77d74d61876cc9984d78e69b9acc2f6 100644 (file)
@@ -3,7 +3,7 @@
 import GLib from 'gi://GLib';
 import Gio from 'gi://Gio';
 
-export const {loadInterfaceXML} = imports.misc.dbusUtils;
+export {loadInterfaceXML} from './dbusUtils.js';
 
 /**
  * @typedef {object} SubdirInfo
index c2d84424a87b68f0107f839a0ca3d1b615ffdbe2..ad7ea7d652f7d6e13af16ffc146c1fe41d04820e 100644 (file)
@@ -11,7 +11,7 @@ import * as Util from '../../misc/util.js';
 
 import {Spinner} from '../animation.js';
 import {QuickToggle, SystemIndicator} from '../quickSettings.js';
-const {loadInterfaceXML} = imports.misc.dbusUtils;
+import {loadInterfaceXML} from '../../misc/dbusUtils.js';
 
 const DBUS_NAME = 'org.freedesktop.background.Monitor';
 const DBUS_OBJECT_PATH = '/org/freedesktop/background/monitor';